import { filterData } from '@/views//patient-info/model';
import { setApiPrefix } from './request';

const $api = setApiPrefix('/hos');
// const $api = setApiPrefix('');

export default {
  getWxSdk(params) {
    return {
      api: $api.get('/jsApi/get/jsParam', params)
    };
  },

  uploadFile(data = {}) {
    return {
      api: $api.post('/upload/patients/h5/ossFile', data, {
        'Content-Type': 'multipart/form-data'
      })
    };
  },
  // login
  login: (params) => {
    return {
      api: $api.get('/platformUserOffiAccount/h5/login', params)
    };
  },

  // 获取床位限制
  isQrcodeLimitPass: (params = {}) => {
    return {
      api: $api.get('/patients/pApp/isQrcodeLimitPass', params)
    };
  },

  // 获取首页设置项
  getHomeSetting: () => {
    return {
      api: $api.get('/settings/pApp/index/get/id')
    };
  },

  // 获取分类接口
  getClassify: (params) => {
    return {
      api: $api.get('/appletsArticleInfo/getMissionCategoryListByPatient', params)
    };
  },

  // 获取文章
  getArticle: (params) => {
    return {
      api: $api.get('/appletsArticleInfo/getMissionUnderArticleByPatient', params)
    };
  },

  // 获取文章
  getTrainingArticleArticle: (params) => {
    return {
      api: $api.get('/trainingArticleInfo/getPage', params)
    };
  },

  //查询食物列表
  getFoodList(params = {}) {
    return {
      api: $api.get('/inOutDetails/food/list', params)
    };
  },
  //查询单个床位出入量总值
  getRecordCountByQrcode4Mini(params = {}) {
    return {
      api: $api.get('/inOutDetails/get/getRecordCountByQrcode4Mini', params)
    };
  },
  //分页查询单个床位出入量列表
  getInOutDetailsList(params = {}) {
    return {
      api: $api.get('/inOutDetails/get/list/qrcodePage4Mini', params)
    };
  },
  //保存出入量
  saveInOutDetails(params = {}) {
    return {
      api: $api.post('/inOutDetails/save/info', params)
    };
  },

  // 患者告知书完成
  finishNotice() {
    return {
      api: $api.post('/patients/pApp/notification/finish')
    };
  },

  // 获取科室列表
  getDeptList() {
    return {
      api: $api.post('/patients/pApp/deptList')
    };
  },

  changeDept(data) {
    return {
      api: $api.post('/patients/pApp/changeDept', data)
    };
  },
  // 获取医院下所有科室
  getHospitalDeptList() {
    return {
      api: $api.get('/department/info/get/patients/department/2hospital')
    };
  },
  // 获取 文章详情
  getArticleInfo(params) {
    return {
      api: $api.get('/appletsArticleInfo/getMissionUnderArticleInfoById', params)
    };
  },

  // 获取培训文章详情
  getTrainingArticleInfo(params) {
    return {
      api: $api.get('/trainingArticleInfo/getInfoById', params)
    };
  },

  // 获取预览文章详情
  getPreviewArticleInfo: (params) => {
    return {
      api: $api.get('/appletsArticleInfo/getPreviewArticleInfoById', params)
    };
  },

  // 获取消息列表
  getMessageList(data) {
    return {
      api: $api.post('/instant/message/get/instant/msg', data)
    };
  },
  // 发送者向接受者发送即时消息
  sendInstantMsg(data = {}) {
    return {
      api: $api.post('/instant/message/send/instant/msg', data)
    };
  },
  //
  saveQuestionAnswer(params) {
    return {
      api: $api.post('/questionAnswer/save/info', params)
    };
  },
  getQuestionInfo(params) {
    return {
      api: $api.get('/question/get/info', params)
    };
  },
  //查询康复社群设置
  getEducationCommunity(params) {
    return {
      api: $api.get('/settings/educationCommunity/pApp/get/id', params)
    };
  },

  //患者查询科室表单设置状态
  getEducation(params) {
    return {
      api: $api.get('/settings/educationConfig/pApp/get/from', params)
    };
  },
  //患者查询医院告知书设置
  getNotification(params) {
    return {
      api: $api.get('/settings/notification/pApp/get/id', params)
    };
  },

  //查询出量类型
  getOutTypeList(params) {
    return {
      api: $api.get('/inOutDetails/out/outTypeList', params)
    };
  },
  //查询消息列表
  getInquiryMessageList(params) {
    return {
      api: $api.post('/user/message/get/messageList2Page', params)
    };
  },

  // 患者表单配置
  getEducationConfig(params) {
    return {
      api: $api.get('/settings/educationConfig/pApp/get/id', params),
      model: filterData
    };
  },

  getAreaList() {
    return {
      api: $api.get('/sys/area/list')
    };
  },
  //
  saveRecoveryOrderInfo(params) {
    return {
      api: $api.post('/recoveryOrder/save/info', params)
    };
  },
  getDictResult(params) {
    return {
      api: $api.post('/dict/getDictResult', params)
    };
  },

  setPatientInfo(params) {
    return {
      api: $api.post('/patients/pApp/in/update/details', params)
    };
  },

  getPatientInfo() {
    return {
      api: $api.get('/patients/pApp/details')
    };
  },
  // 设置已读状态
  haveRead(params) {
    return {
      api: $api.post('/appletsArticleInfo/haveRead', params)
    };
  },
  // 我的消息 已读
  messageHaveRead(params) {
    return {
      api: $api.post('/appletsArticleInfo/message/haveRead', params)
    };
  },
  surplus(params) {
    return {
      api: $api.get('/conversation/get/surplus/amount', params)
    };
  },

  //预览问卷(患者，无token校验)
  getQuestionPreviewInfo(params) {
    return {
      api: $api.get('/question/get/preview/info', params)
    };
  },
  //获取问卷答案接口
  getAnswerInfo(params) {
    return {
      api: $api.get('/question/get/answer/info/byPatients', params)
    };
  },
  // 获取标记组
  getMarks() {
    return {
      api: $api.get('/mark/patients/show')
    };
  }
};
